package com.admin.education.models;

import com.admin.education.repositories.Identifiable;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Entity
@Table(name = "activities")
@EntityListeners(AuditingEntityListener.class)
@Data
public class Activities implements Serializable, Identifiable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
    @Column(name="title")
    @NotBlank
    @Length(max=1024)
    private String title;
    @Column(name="description")
    private String description;
    @Column(name="publisher")
    private String publisher;
    @Column(name="begin_time")
    private Date beginTime;
    @Column(name="end_time")
    private Date endTime;
    @Column(name="end")
    private boolean end;
    @Column(name="create_time")
    @NotNull
    private Date createTime;
    @Column(name="valid")
    @NotNull
    private boolean valid;
}
